<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.shsh.safemanage.model.User"%>
<%@page import="com.shsh.safemanage.util.Constants"%>
<%@page import="com.shsh.safemanage.dao.DaoCreator"%>
<%@page import="java.util.List"%>
<%@page import="com.shsh.safemanage.dao.EquipmentDao"%>
<%@page import="com.shsh.safemanage.model.Department1"%>
<%@page import="com.shsh.safemanage.model.Equipment"%>

<%
{
User loginUser = (User) session.getAttribute(Constants.SESSION_USER);
EquipmentDao equipment1Dao = DaoCreator.createEquipmentDao();
List<Equipment> equip1List = equipment1Dao.getUserMappingEquipmentList(loginUser.getId(), false);
%>
<span style="margin-left: 40px" class="span1">作业部（业务中心）：</span>
<%
	Department1 problemDepart1 = (Department1) session.getAttribute(Constants.SESSION_PROBLEM_DEPARTMENT1);
%>
<span><%=(problemDepart1 == null) ? loginUser.getDepartment1Name() : problemDepart1.getDepartmentName()%></span>
<a href="javascript:" style="font-weight: bold"
	onclick="openDialogPage('choose_department1_1.jsp', 'departListDialog', '选择问题所在作业部')">选择</a>
<span style="margin-left: 40px" class="span1">装置：</span>
<%
	Equipment problemEquip = (Equipment) session.getAttribute(Constants.SESSION_PROBLEM_EQUIPMENT);
	if (equip1List.size() > 0 || problemEquip != null) {
%>
<span><%=(problemEquip == null) ? equip1List.get(0).getEquipName() : problemEquip.getEquipName()%></span>
<input id="problemEquipID" type="hidden" name="problemEquipID"
	value="<%=equip1List.get(0).getId()%>" />
<%
	} else {
%>
<span>非装置</span>
<%
	}
%>
<a href="javascript:" style="font-weight: bold"
	onclick="openDialogPage('choose_equipment1_1.jsp?chooseType=2', 'equipListDialog', '选择问题发生装置')">选择</a>
<%
}
%>